#include <tslib.h>
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <sys/socket.h>
#define SERVER_PORT 8888

int main(int argc , const char *argv[])
{	
	int iClient_fd;
	struct sockaddr_in tSocketServerAddr;
	socklen_t iAddrlen = sizeof(struct sockaddr_in);
	ssize_t iSendlen;
	
	if(argc != 2)
	{
		printf("User: %s <str>\n",argv[0]);
	}
	iClient_fd = socket(AF_INET , SOCK_DGRAM , 0);
	if( -1 == iClient_fd)
	{	
		printf(" socket err!\n ");
		return -1;
	}
	memset(&tSocketServerAddr , 0 , sizeof(tSocketServerAddr));
	tSocketServerAddr.sin_family 		= AF_INET;
	tSocketServerAddr.sin_port   		= htons(SERVER_PORT);
	tSocketServerAddr.sin_addr.s_addr 	= INADDR_ANY;

	
	iSendlen = sendto(iClient_fd, argv[1], strlen(argv[1]), 0 ,(struct sockaddr *)&tSocketServerAddr, iAddrlen);
	return 0;
}

